<template>
  <div>
    <!-- <h1 v-juju="lili"></h1> -->
    <Header></Header>
    <!-- 路由组件出口的地方 -->
    <router-view></router-view>
    <!-- 在Home、Search显示的,在登录、注册隐藏 -->
    <!-- <Footer v-show="$route.path == '/home' || $route.path == '/search'"></Footer> -->
    <Footer v-show="$route.meta.show"></Footer>
  </div>
</template>

<script>
// 引入
import Header from "./components/Header";
import Footer from "./components/Footer";

export default {
  name: "app",
  // 注册
  components: {
    Header,
    Footer,
  },
  // data(){
  //   return{
  //     lili:'churen'
  //   }
  // },
  mounted() {
    // 通知vuex发送请求，获取数据，存储在仓库中
    this.$store.dispatch("categoryList");
  },
};
</script>

<style>
#app {
  font-family: "Avenir", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>